var MiniSite=new Object();
MiniSite.Browser={
    ie:/msie/.test(window.navigator.userAgent.toLowerCase()),
    moz:/gecko/.test(window.navigator.userAgent.toLowerCase()),
    opera:/opera/.test(window.navigator.userAgent.toLowerCase()),
    safari:/safari/.test(window.navigator.userAgent.toLowerCase())
};

MiniSite.JsLoader={
    load:function(sUrl,charset,fCallback){
        var _script=document.createElement('script');
        _script.setAttribute('charset',charset);
        _script.setAttribute('type','text/javascript');
        _script.setAttribute('src',sUrl);
        document.getElementsByTagName('head')[0].appendChild(_script);
        if(MiniSite.Browser.ie){
            _script.onreadystatechange=function(){
                if(this.readyState=='loaded'||this.readyState=='complete'){
                    //fCallback();
					//setTimeout(fCallback, 50);
					setTimeout(function(){try{fCallback();}catch(e){}}, 50);
                }
            };
        }else if(MiniSite.Browser.moz){
            _script.onload=function(){
                //fCallback();
				//setTimeout(fCallback, 50);
				setTimeout(function(){try{fCallback();}catch(e){}}, 50);
            };
        }else{
            //fCallback();
			//setTimeout(fCallback, 50);
			setTimeout(function(){try{fCallback();}catch(e){}}, 50);
        }
    }
};

// tips

MiniSite.JsLoader.load("http://mtips.xunlei.com/tips/tips.1.0.js" , "gb2312" , function(){ loader_kankan_tips1=true;initTips(3) ; } );

MiniSite.JsLoader.load("http://misc.web.xunlei.com/www_5_2/js/kankan_tips.js" , "utf-8" , function(){ loader_kankan_tips2=true; } );
// 轮播图
MiniSite.JsLoader.load("http://misc.web.xunlei.com/www_5_3/js/js4round_new.js" , "utf-8" , function(){ BigNews.init(IndexRecom);if(!BigNews.autoScroller){BigNews.auto(IndexRecom);} } );
// 狗狗自动完成
MiniSite.JsLoader.load("http://misc.web.xunlei.com/www_5_3/js/input_ac4www_new.js" , "utf-8" , function(){ setupAC(document.getElementById("searchbox1"),document.getElementById("btnSearch")); } );

// 观看历史
MiniSite.JsLoader.load("http://misc.web.xunlei.com/www_5_4/js/history_with_recommend.js" , "utf-8" , function(){ buildViewHistory("B0002;","B0003;",16,14,5,24);setTimeout(function(){RelatedRecommender.init();},100)} );